import request from '@/utils/request'

// 查询入库通知单列表
export function listShipNotice(query) {
  return request({
    url: '/purchase/shipNotice/list',
    method: 'post',
    data: query
  })
}

// 查询入库通知单详细
export function getShipNotice(id) {
  return request({
    url: '/purchase/shipNotice/' + id,
    method: 'get'
  })
}

// 新增入库通知单
export function addShipNotice(data) {
  return request({
    url: '/purchase/shipNotice/add',
    method: 'post',
    data: data
  })
}

// 修改入库通知单
export function updateShipNotice(data) {
  return request({
    url: '/purchase/shipNotice/update',
    method: 'post',
    data: data
  })
}

// 删除入库通知单
export function delShipNotice(id) {
  return request({
    url: '/purchase/shipNotice/delete/' + id,
    method: 'post'
  })
}

export function addShipNoticeByPurOrder(data){
  return request({
    url: '/purchase/shipNotice/addByPurOrder',
    method: 'post',
    data: data
  })
}

export function getPrePurShipNotice(id){
  return request({
    url: '/purchase/shipNotice/preShipNotice/' + id,
    method: 'get'
  })
}

export function audit(id){
  return request({
    url: '/purchase/shipNotice/audit/' + id,
    method: 'post'
  })
}

export function auditCancel(id){
  return request({
    url: '/purchase/shipNotice/auditCancel/' + id,
    method: 'post'
  })
}


// 根据勾选更换效期
export function shipNoticeReject(data) {
  return request({
    url: '/purchase/shipNotice/reject',
    method: 'post',
    data: data
  })
}
